<template>
  <div>
    <div id="container"></div>
  </div>
</template>

<script>
export default {
  mounted() {
    window.onLoad = function () {
      var map = new AMap.Map("container");
    };

    // 一定要填写上自己的key 否则后续的高德地图的功能会出现问题
    var url =
      "https://webapi.amap.com/maps?v=1.4.15&key=您申请的key值&callback=onLoad";
    var jsapi = document.createElement("script");
    jsapi.charset = "utf-8";
    jsapi.src = url;
    document.head.appendChild(jsapi);
  },
};
</script>

<style lang="less" scoped>
#container {
  width: 300px;
  height: 400px;
}
</style>